//
//  Authentication AuthenticationVC ViewController.m
//  HappyRent
//
//  Created by CoderYee on 2017/4/7.
//  Copyright © 2017年 内圈科技. All rights reserved.
//

#import "AuthenticationVC.h"
#import "Authentication_SubVC.h"       //
#import "Set_layoutTableViewCell.h"   //下一步
#import "Login_TextFieldTableViewCell.h"
@interface AuthenticationVC ()<BaseTableViewCelldelegate>
{
    UITextField   *_nameTextField; //真实姓名
    
    UITextField   *_IdTextField;  //身份证书

    
    
}
@end

@implementation AuthenticationVC

-(void)addNavbarView{
    
    [super addNavbarView];
    self.title=@"实名认证";
}

-(void)configOwnViews{
    
    [super configOwnViews];
    self.tableView.scrollEnabled=NO;
}
-(void)registerCellClass{
    
    [super registerCellClass];
    
    [self.tableView registerClass:[Set_layoutTableViewCell class] forCellReuseIdentifier:[Set_layoutTableViewCell cellIdentifier]];
    [self.tableView registerClass:[Login_TextFieldTableViewCell class] forCellReuseIdentifier:[Login_TextFieldTableViewCell cellIdentifier]];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return section==0?2:1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
     if (indexPath.section==0){
        
        Login_TextFieldTableViewCell  *cell=[tableView dequeueReusableCellWithIdentifier:[Login_TextFieldTableViewCell cellIdentifier] forIndexPath:indexPath];
         [cell configTableCellindexPath:indexPath];
         
        return cell;
        
    }else{
        
        Set_layoutTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:[Set_layoutTableViewCell cellIdentifier] forIndexPath:indexPath];
        cell.delegate=self;
        [cell.layoutButton setTitle:@"下一步" forState:UIControlStateNormal];
        return cell;
        
    }
}
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, 30)];
    [view setBackgroundColor:kWhiteColor];
    if (section==0) {
        
        UILabel *textLable=[[UILabel alloc] initWithFrame:view.bounds];
        textLable.text=@"  请填写你的真实姓名，通过后将不能修改";
        textLable.textColor=kBlackColor;
        textLable.font=systemfont(14);
        [view addSubview:textLable];
    }
    return view;
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, kMainScreenWidth, 30)];
    if (section==1) {
        
        UILabel *textLable=[[UILabel alloc] initWithFrame:view.bounds];
        textLable.text=@"      实名认证后你的账号将得到更完美的保护,更安全";
        textLable.textColor=kBlackColor;
        textLable.font=systemfont(10);
        [view addSubview:textLable];
    }
    return view;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return section==0?30:20;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
      return section==0?0.01:30;
}
-(void)clickTableView:(BaseTableViewCell*)tableCell withEventType:(TableClickEvent)eventValue{
    
    Authentication_SubVC *Vc=[[Authentication_SubVC alloc] init];
    [self.navigationController pushViewController:Vc animated:YES];
    
}

@end
